const apiService = require('../../js/services/api/sharedDatabaseService');

Page({
  data: {
    skills: [],
    loading: false,
    error: ''
  },

  onLoad: function() {
    this.testSkillsApi();
  },

  testSkillsApi: function() {
    this.setData({ loading: true, error: '' });

    apiService.getSkills()
      .then(result => {
        console.log('API测试结果:', result);
        this.setData({
          skills: result.data || [],
          loading: false
        });
      })
      .catch(error => {
        console.error('API测试失败:', error);
        this.setData({
          error: error.message || '未知错误',
          loading: false
        });
      });
  }
});